package IOperation;

import Book.BookList;

import java.util.Scanner;

public class backOperation implements IOperation{

    @Override
    public void work(BookList bookList) {
        System.out.println("归还书");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要归还的书");
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getBookSize(); i++) {
            if(bookList.getBook(i).getName().equals(name)){
                bookList.getBook(i).setBorrowed(false);
                System.out.println("归还成功");
            }
        }

    }
}
